import { createRouter, createWebHistory } from 'vue-router'
import main from '@/components/main'
import showImg from '@/components/showImg'
import showTable from '@/components/showTable'
import login from '@/components/login'
import weather from '@/components/weather'
import search from '@/components/search'
import select from '@/components/select'

const routerHistory = createWebHistory()

const routes = [
  {
    path: '/',
    name: 'login',
    component: login
  },
  {
    path: '/main',
    name: 'main',
    component: main,
    children: [
      {
        path: '/showImg',
        name: 'showImg',
        component: showImg
      },
      {
        path: '/showTable',
        name: 'showTable',
        component: showTable
      },
      {
        path: '/weather',
        name: 'weather',
        component: weather
      },
      {
        path: '/search',
        name: 'search',
        component: search
      },
      {
        path: '/select',
        name: 'select',
        component: select
      }
    ]
  }
]

const router = createRouter({
  history: routerHistory,
  routes
})

export default router
